import 'package:flutter/material.dart';

import './function_button_data.dart';

class FunctionButtonItemWidgets extends StatelessWidget {
  final FunctionButtonItem data;

  const FunctionButtonItemWidgets(this.data, {Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var width = MediaQuery.of(context).size.width * 0.2 - 20;
    return GestureDetector(
      onTap: (){
        if (null != data.onTapHandle) {
          data.onTapHandle(context);
        }
      },
      child: Container(
        width: width,
        padding: EdgeInsets.only(top: 30.0),
        child: Column(
          children: [
            Image.asset(
              data.imgageUrl,
              width: 64.0,
              height: 64.0,
              fit: BoxFit.fill,
            ),
            SizedBox(height: 5.0,),
            Text(data.title)
          ],
        ),
      ),
    );
  }
}